home *** CD-ROM | disk | FTP | other *** search
- // Borland C++ Builder
- // Copyright (c) 1995, 1998 by Borland International
- // All rights reserved
-
- // (DO NOT EDIT: machine generated header) 'Menus.pas' rev: 3.00
-
- #ifndef MenusHPP
- #define MenusHPP
- #include <Messages.hpp>
- #include <Classes.hpp>
- #include <SysUtils.hpp>
- #include <Windows.hpp>
- #include <SysInit.hpp>
- #include <System.hpp>
-
- //-- user supplied -----------------------------------------------------------
-
- namespace Menus
- {
- //-- type declarations -------------------------------------------------------
- class DELPHICLASS EMenuError;
- class PASCALIMPLEMENTATION EMenuError : public Sysutils::Exception
- {
- typedef Sysutils::Exception inherited;
-
- public:
- /* Exception.Create */ __fastcall EMenuError(const System::AnsiString Msg) : Sysutils::Exception(Msg
- ) { }
- /* Exception.CreateFmt */ __fastcall EMenuError(const System::AnsiString Msg, const System::TVarRec
- * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
- /* Exception.CreateRes */ __fastcall EMenuError(int Ident, Extended Dummy) : Sysutils::Exception(Ident
- , Dummy) { }
- /* Exception.CreateResFmt */ __fastcall EMenuError(int Ident, const System::TVarRec * Args, const int
- Args_Size) : Sysutils::Exception(Ident, Args, Args_Size) { }
- /* Exception.CreateHelp */ __fastcall EMenuError(const System::AnsiString Msg, int AHelpContext) :
- Sysutils::Exception(Msg, AHelpContext) { }
- /* Exception.CreateFmtHelp */ __fastcall EMenuError(const System::AnsiString Msg, const System::TVarRec
- * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext
- ) { }
- /* Exception.CreateResHelp */ __fastcall EMenuError(int Ident, int AHelpContext) : Sysutils::Exception(
- Ident, AHelpContext) { }
- /* Exception.CreateResFmtHelp */ __fastcall EMenuError(int Ident, const System::TVarRec * Args, const
- int Args_Size, int AHelpContext) : Sysutils::Exception(Ident, Args, Args_Size, AHelpContext) { }
-
- public:
- /* TObject.Destroy */ __fastcall virtual ~EMenuError(void) { }
-
- };
-
- enum TMenuBreak { mbNone, mbBreak, mbBarBreak };
-
- typedef Word TShortCut;
-
- typedef void __fastcall (__closure *TMenuChangeEvent)(System::TObject* Sender, bool Rebuild);
-
- class DELPHICLASS TMenuItem;
- class DELPHICLASS TMenu;
- enum TFindItemKind { fkCommand, fkHandle, fkShortCut };
-
- class PASCALIMPLEMENTATION TMenu : public Classes::TComponent
- {
- typedef Classes::TComponent inherited;
-
- private:
- TMenuItem* FItems;
- HWND FWindowHandle;
- System::AnsiString FMenuImage;
- void __fastcall SetWindowHandle(HWND Value);
- bool __fastcall UpdateImage(void);
-
- protected:
- virtual void __fastcall MenuChanged(System::TObject* Sender, bool Rebuild);
- DYNAMIC void __fastcall GetChildren(Classes::TGetChildProc Proc, Classes::TComponent* Root);
- virtual HMENU __fastcall GetHandle(void);
- DYNAMIC void __fastcall SetChildOrder(Classes::TComponent* Child, int Order);
-
- public:
- __fastcall virtual TMenu(Classes::TComponent* AOwner);
- __fastcall virtual ~TMenu(void);
- bool __fastcall DispatchCommand(Word ACommand);
- bool __fastcall DispatchPopup(HMENU AHandle);
- TMenuItem* __fastcall FindItem(int Value, TFindItemKind Kind);
- Classes::THelpContext __fastcall GetHelpContext(int Value, bool ByCommand);
- bool __fastcall IsShortCut(Messages::TWMKey &Message);
- __property HMENU Handle = {read=GetHandle, nodefault};
- __property HWND WindowHandle = {read=FWindowHandle, write=SetWindowHandle, nodefault};
-
- __published:
- __property TMenuItem* Items = {read=FItems};
- };
-
- class PASCALIMPLEMENTATION TMenuItem : public Classes::TComponent
- {
- typedef Classes::TComponent inherited;
-
- private:
- System::AnsiString FCaption;
- HMENU FHandle;
- bool FChecked;
- bool FEnabled;
- bool FDefault;
- bool FRadioItem;
- bool FVisible;
- Byte FGroupIndex;
- TMenuBreak FBreak;
- Word FCommand;
- Classes::THelpContext FHelpContext;
- System::AnsiString FHint;
- Classes::TList* FItems;
- TShortCut FShortCut;
- TMenuItem* FParent;
- TMenuItem* FMerged;
- TMenuItem* FMergedWith;
- TMenu* FMenu;
- TMenuChangeEvent FOnChange;
- Classes::TNotifyEvent FOnClick;
- void __fastcall AppendTo(HMENU Menu);
- void __fastcall ClearHandles(void);
- void __fastcall ReadShortCutText(Classes::TReader* Reader);
- void __fastcall MergeWith(TMenuItem* Menu);
- void __fastcall RebuildHandle(void);
- void __fastcall PopulateMenu(void);
- void __fastcall SubItemChanged(System::TObject* Sender, bool Rebuild);
- void __fastcall TurnSiblingsOff(void);
- void __fastcall WriteShortCutText(Classes::TWriter* Writer);
- void __fastcall VerifyGroupIndex(int Position, Byte Value);
-
- protected:
- virtual void __fastcall DefineProperties(Classes::TFiler* Filer);
- HMENU __fastcall GetHandle(void);
- int __fastcall GetCount(void);
- DYNAMIC void __fastcall GetChildren(Classes::TGetChildProc Proc, Classes::TComponent* Root);
- TMenuItem* __fastcall GetItem(int Index);
- int __fastcall GetMenuIndex(void);
- DYNAMIC Classes::TComponent* __fastcall GetParentComponent(void);
- virtual void __fastcall MenuChanged(bool Rebuild);
- DYNAMIC bool __fastcall HasParent(void);
- void __fastcall SetBreak(TMenuBreak Value);
- void __fastcall SetCaption(const System::AnsiString Value);
- void __fastcall SetChecked(bool Value);
- DYNAMIC void __fastcall SetChildOrder(Classes::TComponent* Child, int Order);
- void __fastcall SetDefault(bool Value);
- void __fastcall SetEnabled(bool Value);
- void __fastcall SetGroupIndex(Byte Value);
- void __fastcall SetMenuIndex(int Value);
- DYNAMIC void __fastcall SetParentComponent(Classes::TComponent* Value);
- void __fastcall SetRadioItem(bool Value);
- void __fastcall SetShortCut(TShortCut Value);
- void __fastcall SetVisible(bool Value);
-
- public:
- __fastcall virtual TMenuItem(Classes::TComponent* AOwner);
- __fastcall virtual ~TMenuItem(void);
- HIDESBASE void __fastcall Insert(int Index, TMenuItem* Item);
- void __fastcall Delete(int Index);
- virtual void __fastcall Click(void);
- int __fastcall IndexOf(TMenuItem* Item);
- void __fastcall Add(TMenuItem* Item);
- HIDESBASE void __fastcall Remove(TMenuItem* Item);
- __property Word Command = {read=FCommand, nodefault};
- __property HMENU Handle = {read=GetHandle, nodefault};
- __property int Count = {read=GetCount, nodefault};
- __property TMenuItem* Items[int Index] = {read=GetItem/*, default*/};
- __property int MenuIndex = {read=GetMenuIndex, write=SetMenuIndex, nodefault};
- __property TMenuItem* Parent = {read=FParent};
-
- __published:
- __property TMenuBreak Break = {read=FBreak, write=SetBreak, default=0};
- __property System::AnsiString Caption = {read=FCaption, write=SetCaption};
- __property bool Checked = {read=FChecked, write=SetChecked, default=0};
- __property bool Default = {read=FDefault, write=SetDefault, default=0};
- __property bool Enabled = {read=FEnabled, write=SetEnabled, default=1};
- __property Byte GroupIndex = {read=FGroupIndex, write=SetGroupIndex, default=0};
- __property Classes::THelpContext HelpContext = {read=FHelpContext, write=FHelpContext, default=0};
- __property System::AnsiString Hint = {read=FHint, write=FHint};
- __property bool RadioItem = {read=FRadioItem, write=SetRadioItem, default=0};
- __property TShortCut ShortCut = {read=FShortCut, write=SetShortCut, default=0};
- __property bool Visible = {read=FVisible, write=SetVisible, default=1};
- __property Classes::TNotifyEvent OnClick = {read=FOnClick, write=FOnClick};
- };
-
- class DELPHICLASS TMainMenu;
- class PASCALIMPLEMENTATION TMainMenu : public Menus::TMenu
- {
- typedef Menus::TMenu inherited;
-
- private:
- HMENU FOle2Menu;
- bool FAutoMerge;
- void __fastcall ItemChanged(void);
- void __fastcall SetAutoMerge(bool Value);
-
- protected:
- virtual void __fastcall MenuChanged(System::TObject* Sender, bool Rebuild);
- virtual HMENU __fastcall GetHandle(void);
-
- public:
- void __fastcall Merge(TMainMenu* Menu);
- void __fastcall Unmerge(TMainMenu* Menu);
- void __fastcall PopulateOle2Menu(HMENU SharedMenu, const int * Groups, const int Groups_Size, int *
- Widths, const int Widths_Size);
- void __fastcall GetOle2AcceleratorTable(HACCEL &AccelTable, int &AccelCount, const int * Groups, const
- int Groups_Size);
- void __fastcall SetOle2MenuHandle(HMENU Handle);
-
- __published:
- __property bool AutoMerge = {read=FAutoMerge, write=SetAutoMerge, default=0};
- public:
- /* TMenu.Create */ __fastcall virtual TMainMenu(Classes::TComponent* AOwner) : Menus::TMenu(AOwner)
- { }
- /* TMenu.Destroy */ __fastcall virtual ~TMainMenu(void) { }
-
- };
-
- enum TPopupAlignment { paLeft, paRight, paCenter };
-
- class DELPHICLASS TPopupMenu;
- class PASCALIMPLEMENTATION TPopupMenu : public Menus::TMenu
- {
- typedef Menus::TMenu inherited;
-
- private:
- TPopupAlignment FAlignment;
- bool FAutoPopup;
- Classes::TComponent* FPopupComponent;
- Classes::TNotifyEvent FOnPopup;
- void __fastcall DoPopup(System::TObject* Item);
- HIDESBASE Classes::THelpContext __fastcall GetHelpContext(void);
- void __fastcall SetHelpContext(Classes::THelpContext Value);
-
- public:
- __fastcall virtual TPopupMenu(Classes::TComponent* AOwner);
- __fastcall virtual ~TPopupMenu(void);
- virtual void __fastcall Popup(int X, int Y);
- __property Classes::TComponent* PopupComponent = {read=FPopupComponent, write=FPopupComponent};
-
- __published:
- __property TPopupAlignment Alignment = {read=FAlignment, write=FAlignment, default=0};
- __property bool AutoPopup = {read=FAutoPopup, write=FAutoPopup, default=1};
- __property Classes::THelpContext HelpContext = {read=GetHelpContext, write=SetHelpContext, default=0
- };
- __property Classes::TNotifyEvent OnPopup = {read=FOnPopup, write=FOnPopup};
- };
-
- //-- var, const, procedure ---------------------------------------------------
- #define scShift (Word)(8192)
- #define scCtrl (Word)(16384)
- #define scAlt (int)(32768)
- #define scNone (Byte)(0)
- extern PACKAGE TShortCut __fastcall ShortCut(Word Key, Classes::TShiftState Shift);
- extern PACKAGE void __fastcall ShortCutToKey(TShortCut ShortCut, Word &Key, Classes::TShiftState &Shift
- );
- extern PACKAGE System::AnsiString __fastcall ShortCutToText(TShortCut ShortCut);
- extern PACKAGE TShortCut __fastcall TextToShortCut(System::AnsiString Text);
- extern PACKAGE TMainMenu* __fastcall NewMenu(Classes::TComponent* Owner, const System::AnsiString AName
- , TMenuItem* const * Items, const int Items_Size);
- extern PACKAGE TPopupMenu* __fastcall NewPopupMenu(Classes::TComponent* Owner, const System::AnsiString
- AName, TPopupAlignment Alignment, bool AutoPopup, TMenuItem* const * Items, const int Items_Size);
- extern PACKAGE TMenuItem* __fastcall NewSubMenu(const System::AnsiString ACaption, Word hCtx, const
- System::AnsiString AName, TMenuItem* const * Items, const int Items_Size);
- extern PACKAGE TMenuItem* __fastcall NewItem(const System::AnsiString ACaption, TShortCut AShortCut,
- bool AChecked, bool AEnabled, Classes::TNotifyEvent AOnClick, Word hCtx, const System::AnsiString AName
- );
- extern PACKAGE TMenuItem* __fastcall NewLine(void);
- extern PACKAGE System::AnsiString __fastcall StripHotKey(const System::AnsiString Text);
-
- } /* namespace Menus */
- #if !defined(NO_IMPLICIT_NAMESPACE_USE)
- using namespace Menus;
- #endif
- //-- end unit ----------------------------------------------------------------
- #endif // Menus
-